package com.fmy.jurisdiction.modular.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fmy.jurisdiction.core.commons.consts.RegularConsts;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author Mr.fmy
 * @since 2019-09-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AdminUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户姓名
     */
    @NotBlank(message = "请输入用户姓名")
    private String userName;

    /**
     * 用户登录名
     */
    @NotBlank(message = "请输入用户登录名")
    private String userLogin;

    /**
     * 用户手机号
     */
    @NotBlank(message = "请输入用户手机号")
    @Pattern(regexp = RegularConsts.PHONE, message = "请输入正确的手机号(11位)")
    private String userPhone;

    /**
     * 密码
     */
    @NotBlank(message = "请输入用户密码")
    @Pattern(regexp = RegularConsts.PWD_REGULAR, message = "密码长度应在6~18位、且必须包含 数字,英文,字符中的两种以上")
    private String password;

    /**
     * 盐值
     */
    private String salt;

    /**
     * 角色集合 以 , 分割
     */
    private String roles;

    /**
     * 部门
     */
    @NotNull(message = "请选择部门")
    private Integer deptId;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 创建人
     */
    private Integer createUser;

    /**
     * 修改时间
     */
    private Date modifyTime;

    /**
     * 修改人
     */
    private Integer modifyUser;

    /**
     * 用户状态 0停用 1启用
     */
    private Boolean status;

    /**
     * 删除标识
     */
    private Boolean delFlag;


    public static final String ID = "id";

    public static final String USER_NAME = "user_name";

    public static final String USER_LOGIN = "user_login";

    public static final String USER_PHONE = "user_phone";

    public static final String PASSWORD = "password";

    public static final String SALT = "salt";

    public static final String ROLES = "roles";

    public static final String DEPT_ID = "dept_id";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATE_USER = "create_user";

    public static final String MODIFY_TIME = "modify_time";

    public static final String MODIFY_USER = "modify_user";

    public static final String STATUS = "status";

    public static final String DEL_FLAG = "del_flag";

    public static final String ID_FIELD = "id";

    public static final String USERNAME_FIELD = "userName";

    public static final String USERLOGIN_FIELD = "userLogin";

    public static final String USERPHONE_FIELD = "userPhone";

    public static final String PASSWORD_FIELD = "password";

    public static final String SALT_FIELD = "salt";

    public static final String ROLES_FIELD = "roles";

    public static final String DEPT_ID_FIELD = "deptId";

    public static final String STATUS_FIELD = "status";

    public static final String DELFLAG_FIELD = "delFlag";

    public static final String CREATE_TIME_FIELD = "createTime";

    public static final String CREATE_USER_FIELD = "createUser";

    public static final String MODIFY_TIME_FIELD = "modifyTime";

    public static final String MODIFY_USER_FIELD = "modifyUser";

}
